<template>

  <div class="app-container">


<div style="width:85%; height: 10%;   border: 1px solid white; float:left">

              <el-row :gutter="25">
              <el-col :span="4">
              <label class="label-one">设备名称:</label>
              <select id="cameraInfo" class="select-one"  @click="switchCameraInfo_Fun1()"></select><br>
              </el-col>
             <el-col :span="4" hidden>>
                <label class="label-one">视频格式:</label>
              <select id="mediaType" class="select-one" @click="setCameraInfo_Fun()"></select><br>
              </el-col>
              <el-col :span="4">
              <label class="label-one">分辨率:</label>
              <select id="resolution" class="select-one" @click="setCameraInfo_Fun1()"></select><br>
              </el-col>
              <el-col :span="4">
              <label class="label-one">旋转方式:</label>
              <select id="rotateType" class="select-one" @click="OnRotateChange1()">
                <option value="0">不旋转</option>
                <option value="90">旋转90度</option>
                <option value="180">旋转180度</option>
                <option value="270">旋转270度</option>
                <option value="361" id="opOcrDirection" disabled>自动文字方向</option>
              </select><br>
              </el-col>
              <el-col :span="4">
              <label class="label-one">裁切方式:</label>
              <select id="crop_type" class="select-one" @click="setCameraImageInfo_Fun1()">
                <option value="0">不裁切</option>
                <option value="1">单图裁切</option>
                <option value="2">多图裁切</option>
                <!--<option value="3">曲面矫正</option>-->
                <!--<option value="6">桌面裁切</option>-->
              <option value="9">自定义裁切</option>
              </select><br>
              </el-col>
              <el-col :span="4">
              <label class="label-one">图像效果:</label>
              <select id="image_type" class="select-one" @click="tuxiang1()">
                <option value="0">彩色原色</option>
                <option value="1">灰度图片</option>
                <option value="2">黑白文档</option>
                <option value="3">彩色文档</option>
                <option value="4">红印文档</option>
                <option value="5">蓝印文档</option>
                <option value="6">彩色照片</option>
                <option value="7">票据增强</option>
              </select><br>
              </el-col>
             <!-- <el-col :span="4">
              <label class="label-one">补边:</label>
              <select id="fill_border" class="select-one">
                <option value="0">不填充</option>
                <option value="1">映射填充</option>
                <option value="2">白色填充</option>
                <option value="3">自动纯色填充</option>
              </select><br>
              </el-col>-->
            <!--  <el-col :span="4">
              <label class="label-one">异物去除:</label>
              <select id="foreign_remove" class="select-one">
                <option value="0">无</option>
                &lt;!&ndash;<option value="1">去除手指(拍书时)</option>&ndash;&gt;
                <option value="2">去除装订孔</option>
                &lt;!&ndash;<option value="3">去除装订方孔</option>&ndash;&gt;
              </select>
              </el-col>-->
<!--
              <label >USB按键:</label>
              <select id="selExtButton" class="select-one" onchange="OnExtButtonChange()">
                <option value="None" selected>不启用</option>
                <option value="Notify">发通知</option>
                <option value="CameraCapture">触发拍照</option>
                <option value="CameraCaptureBook" disabled title="在此页面中不适用">触发拍书</option>
                <option value="RecogBarCode">触发条码识别</option>
              </select>-->
              <el-col :span="4">
              <label class="label-one">曝光:</label>
              <input id="export" class="select-one" type="range" value="0" max="0" min="0" @click="SetVideoParam1()"><br />
<!--
              <input type="checkbox" checked id="expCheck" onchange="SetVideoParam()"><label for="expCheck" class="label-one">自动曝光</label><br>
-->
              </el-col>
              <el-col :span="4">
                <label class="label-one">DPI:</label>
              <input id="dpi"  class="select-one" @click="dpi1()"type="text"  value="0">
              </el-col>
              <!--<label >结果显示:</label>
              <textarea id="resultArea"></textarea>-->
            </el-row>



            <div style="background-color:#f8f8f9;border: 2px solid white;margin-top: 17px;">
              <img id="pic" style=" display: block;
            margin: 0 auto;"/>

              <div style="width: 150px;margin:5px auto;">



                <el-button id="clearImage" @click="clearImageFile1()">清空照片</el-button>
             <!--  <el-button  @click="ocrFile1()">ocr</el-button>
              <el-button  @click="ZoomIn1()">大</el-button>-->
              </div>

            </div>
</div>

<div style="width:10%;height: 10%;   border: 1px solid white;  float:right;margin-top: 10px;">
  <el-button id="CaptureBase64" style="color: white;background-color:#5676e9;height: 50px" @click="cameraCapture_Fun1()">拍照</el-button>
</div>


           <div style="width:15%; height: 200px; border: 1px solid #ccc;  float:left;margin-top: 40px; ">
             <tbody id="image_data" align="right"></tbody>


           </div>



  </div>

</template>
<style>

</style>
<script>
  import { listVerify, getVerify, delVerify, addVerify, updateVerify,updateP } from "@/api/module/gs/verify/verify";

 /* import {ocrFile
  } from "@/api/module/gs/AutoCaptureCustom";*/

  import {switchCameraInfo_Fun,cameraCapture_Fun,setCameraImageInfo_Fun,clearImageFile,setCameraInfo_Fun,OnRotateChange
    ,SetVideoParam,tuxiang,dpi,zoomin,ZoomOut,ocrFile
  } from "@/api/module/gs/camera";



  export default {
    name: "Verify",
    mounted() {
      //this.LoadCameraDocument()
   //   this.SelectDevice()
    },
    data() {
      return {
        formData: {
          field108: undefined,
          field109: undefined,
          field120: undefined,
          field121: undefined,
          field122: undefined,
          field123: [],
          field124: "水印",
          field125: "100",
          field126: "80",
          field127: 4,
          field128: 0,
          field129: [],
        },
        locfilepath: [] || "",
        field108Options: [{
          "id": "Radio1",
          "label": "不裁切",
          "value": "V1"

        }, {
          "label": "手动裁切",
          "value": "V2",
          "id": "Radio2"
        }, {
          "label": "自动裁切",
          "value": "V3",
          "id": "Radio3"
        }, {
          "label": "自定义",
          "value": "V4",
          "id": "Radio4"
        }],
        field109Options: [{
          "label": "jpg",
          "value": 0
        }, {
          "label": "png",
          "value": 1
        }, {
          "label": "tif",
          "value": 2
        }, {
          "label": "pdf",
          "value": 3
        }],
        field120Options: [{
          "label": "彩色",
          "value": 0
        }, {
          "label": "灰度",
          "value": 1
        }, {
          "label": "黑白",
          "value": 2
        }],
        field121Options: [{
          "label": "10",
          "value": 0
        }, {
          "label": "20",
          "value": 1
        }, {
          "label": "30",
          "value": 2
        }, {
          "label": "40",
          "value": 3
        }, {
          "label": "50",
          "value": 4
        }, {
          "label": "60",
          "value": 5
        }, {
          "label": "70",
          "value": 6
        }, {
          "label": "80",
          "value": 7
        }, {
          "label": "90",
          "value": 8
        }, {
          "label": "100",
          "value": 9
        }],
        field122Options: [{
          "label": "100",
          "value": 0
        }, {
          "label": "200",
          "value": 1
        }, {
          "label": "300",
          "value": 2
        }, {
          "label": "400",
          "value": 3
        }, {
          "label": "500",
          "value": 4
        }, {
          "label": "600",
          "value": 5
        }],
        field123Options: [{
          "label": "",
          "value": 0
        }],
        field127Options: [{
          "label": "左上",
          "value": 0
        }, {
          "label": "右上",
          "value": 1
        }, {
          "label": "左下",
          "value": 2
        }, {
          "label": "右下",
          "value": 3
        }, {
          "label": "中间",
          "value": 4
        }],
        field128Options: [{
          "label": "红色",
          "value": 0
        }, {
          "label": "绿色",
          "value": 1
        }, {
          "label": "蓝色",
          "value": 2
        }, {
          "label": "青色",
          "value": 3
        }, {
          "label": "黄色",
          "value": 4
        }, {
          "label": "白色",
          "value": 5
        }, {
          "label": "黑色",
          "value": 6
        }],
        field129Options: [{
          "label": "",
          "value": 0
        }],
        value: ''
      };
    },
    created() {
      this.lujing()
    },

    methods: {

      setCameraImageInfo_Fun1(){
        setCameraImageInfo_Fun()
      },
      tuxiang1(){
        tuxiang();
      },
      lujing(){
        console.log(window.location.href+"path")
      },
      ocrFile1(){
        ocrFile();
      },
      /*********************
       ***    关闭摄像头  ***
       **********************/
      toCloseCamera() {
        Cam_Close();
      },
      cameraCapture_Fun1(){


        var name = new Date().getTime();
        var path = "D:\\" + name + ".jpg";
        cameraCapture_Fun(path);
      },
      clearImageFile1(){
        clearImageFile();
      },
      switchCameraInfo_Fun1(){
        switchCameraInfo_Fun();
      },
      setCameraInfo_Fun1(){
        setCameraInfo_Fun();
      },
      OnRotateChange1(){
        OnRotateChange();
      },
      SetVideoParam1(){
        SetVideoParam();
      },
      dpi1(){
        dpi();
      },
      ZoomIn1(){
        zoomin();
      },
  /*********************
       ***    切换摄像头  ***
       **********************/
      SelectDevice() {
        /*    var CamID = document.getElementById("DevName").selectedIndex;
        //获取分辨率
        Cam_GetDevResolution(CamID);*/
        switchCameraInfo_Fun();
      },


    }
  }
</script>
<style>
  .label-one{
    text-align: right;
    vertical-align: middle;
    float: left;
    font-size: 13px;
    color: #606266;
    line-height: 40px;
     width:70px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
  }

.select-one{
margin-top: 5px;
  margin-left:5px;
  border:1px solid #cccccc;
  background-color:#fff;
  color:#cccccc;
  height:25px;
  width: 125px;
  line-height:25px;
  padding:4px 6px;
  font-size:12px;
  border-radius:5px;
  cursor:pointer;
  outline:none;

}
</style>
